#include <accent/algorithms/for_each.hpp>
#include "test_base.hpp"

class ForEach : public ::testing::TestWithParam<ivec> {};

TEST_P(ForEach, trackerCollectsInputRange) {
  ivec v = GetParam(), a;
  auto r = all(v);
  for_each(r, [&a](int i) { a.push_back(i); });
  ASSERT_EQ(v, a);
}

INSTANTIATE_TEST_CASE_P(variousVectors, ForEach,
  ::testing::Values(ivec{}, ivec{1}, ivec{1, 2}, ivec{1, 2, 3}));
